import "./index.scss";
// import './utils/tools'
import './directive/index'
import './prototype/index'

import { SkyButton, SkyButtonGroup } from './packages/Button/'
import { SkySingleChoose, SkySingleChooseGroup } from './packages/SingleChoose/'
import { SkyMuchChoose, SkyMuchChooseGroup } from './packages/MuchChoose/'
import { SkyDialog } from './packages/Dialog/'
import { SkyOutSide } from './packages/OutSide/'
import { SkyCardPanel } from './packages/CardPanel/'
import { SkyCard } from './packages/Card/'
import { SkySteps, SkyStepItem } from './packages/ArticleSteps/'
import { SkyLeftTabs, SkyLeftTabPane } from './packages/LeftTabs/'
import { SkyTopTabs, SkyTopTabPane } from './packages/TopTabs/'
import { SkyTreeTable, SkyTreeColumn } from './packages/TreeTable/'
import { SkyTable, SkyColumn } from './packages/Table/'
import { SkyTree } from './packages/Tree/'
import { SkyMatrix, SkyRow, SkyUnit } from './packages/Matrix/'
import { SkyCatalogContainer, SkyCatalogPage } from './packages/Catalog/'
import { SkyDropSelect } from './packages/DropSelect/'
import { SkyInput } from './packages/Input/'
import { SkyForm, SkyFormItem } from './packages/Form/'
import { SkyCheckbox, SkyCheckboxGroup } from './packages/Checkbox/'
import { SkyRadio, SkyRadioGroup } from './packages/Radio/'
import { SkyPointPage } from './packages/PointPages/'
import { SkyLayoutRow, SkyLayoutCol } from './packages/Row/'
import { SkyHiddenPanel } from './packages/HiddenPanel/'
import { SkyUnicode } from './packages/Unicode/'
import { SkyIconFont } from './packages/IconFont/'
import { SkyIconSymbol } from './packages/Symbol/'
import { SkyUpLoad } from './packages/UpLoad/'
import { SkyCalendar } from './packages/Calendar/'
import { SkySwitch } from './packages/Switch/'
import { SkyDrawer } from './packages/Drawer/'
import { SkyFixedSidebar } from './packages/FixedSidebar/'
import { SkyTextarea } from './packages/Textarea/'
import { SkyFoldingPanel } from './packages/FoldingPanel/'
import { SkyInputPopUp } from './packages/InputPopUp/'
import SkyShuttle from './packages/Shuttle/index.vue'
import { SkySignature } from './packages/Signature/'


import SkyConfirm from './packages/Confirm'
import SkyMessage from './packages/Message'
import SkyNotification from './packages/Notification/'
import SkyLoading from './packages/Loading/'
// import SkyToolTip from './packages/ToolTip/'
import SkyPopperPanel from './packages/PopperPanel/'
import ElePackages from "./elepackages/index"

import "./command/thousands-directive"
import "./command/rate-directive"
import "./command/verify-directive"


import * as filters from './filters'

export const components = [
  SkyButton,
  SkyButtonGroup,
  SkySingleChoose,
  SkySingleChooseGroup,
  SkyMuchChoose,
  SkyMuchChooseGroup,
  SkyDialog,
  SkyOutSide,
  SkyCard,
  SkyCardPanel,
  SkySteps,
  SkyStepItem,
  SkyLeftTabs,
  SkyLeftTabPane,
  SkyTopTabs,
  SkyTopTabPane,
  SkyTreeTable,
  SkyTreeColumn,
  SkyTable,
  SkyColumn,
  SkyTree,
  SkyMatrix,
  SkyRow,
  SkyUnit,
  SkyCatalogContainer,
  SkyCatalogPage,
  SkyDropSelect,
  SkyInput,
  SkyForm,
  SkyFormItem,
  SkyCheckbox,
  SkyCheckboxGroup,
  SkyRadio,
  SkyRadioGroup,
  SkyPointPage,
  SkyLayoutRow,
  SkyLayoutCol,
  SkyHiddenPanel,
  SkyUnicode,
  SkyIconFont,
  SkyIconSymbol,
  SkyUpLoad,
  SkyCalendar,
  SkySwitch,
  SkyDrawer,
  SkyFixedSidebar,
  SkyTextarea,
  SkyFoldingPanel,
  SkyInputPopUp,
  SkyShuttle,
  SkySignature
]

const install = function (Vue, opts = {}) {

  Vue.use(ElePackages)

  components.forEach(component => {
    Vue.component(component.name, component);
  });

  Vue.prototype.$SkyConfirm = SkyConfirm;
  Vue.prototype.$SkyMessage = SkyMessage;
  Vue.prototype.$SkyNotification = SkyNotification;
  Vue.prototype.$SkyLoading = SkyLoading;
  // Vue.prototype.$SkyToolTip = SkyToolTip.installToolTip;
  Vue.prototype.$SkyPopperPanel = SkyPopperPanel;







  //vue原型链挂载总线
  Vue.prototype.bus = new Vue();

  //注册过滤器
  Object.keys(filters).forEach((key) => {
    Vue.filter(key, filters[key])
  })

}

/* istanbul ignore if */
if (typeof window !== 'undefined' && window.Vue) {
  install(window.Vue);
}

export default {
  install
}


